t = codesters.Teacher()
go_tos = t.find_function("go_to")
go_to_params = t.get_parameters_for_function("go_to")
try:
tval1 = go_tos[2][1]
tval2 = t.get_indent_at_line(go_tos[2][0])
tval3 = int(go_to_params[2][0])
tval4 = int(go_to_params[2][1])
except:
tval1 = "DNE"
tval2 = "DNE"
tval3 = "DNE"
tval4 = "DNE"
t1 = TestObjective()
t1.add_success("ball." in tval1, "Great job!")
t1.add_failure("sprite." in tval1, "Did you change the name in front of .go_to() from sprite to ball?")
t1.add_failure(tval1 == "DNE", 'Did you drag in Go To inside your click event?')
t2 = TestObjective()
t2.add_success(tval2 == 4, "Great job!")
t2.add_failure(tval2 == 0, 'Oops! Did you forget to indent your .go_to() command?')
t2.add_failure(tval2 > 4, 'Oops! Did you indent your .go_to() command too many times?')
t2.add_failure(tval2 == "DNE", 'Did you drag in Go To inside your click event?')
t3 = TestObjective()
t3.add_success(tval3 == -175, "Great job!")
t3.add_failure(tval3 == -100, "Did you change the x-coordinate in your .go_to() command?")
t3.add_failure(tval3 == "DNE", 'Did you drag in Go To inside your click event?')
t4 = TestObjective()
t4.add_success(tval3 == -125, "Great job!")
t4.add_failure(tval3 == -50, "Did you change the x-coordinate in your .go_to() command?")
t4.add_failure(tval3 == "DNE", 'Did you drag in Go To inside your click event?')
tester = TestManager()
tester.add_test_list([t1, t2, t3, t4])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.